home *** CD-ROM | disk | FTP | other *** search
Wrap
on cursorOff global colorcrsr, YugoCursors, gCursorSwitch if objectp(colorcrsr) then colorcrsr(mGetSetCursor, getProp(YugoCursors, #noCursor)) set gCursorSwitch to #off else cursor(200) set gCursorSwitch to #off end if end on cursorOn global colorcrsr, YugoCursors, thisCursor, gCursorSwitch if gCursorSwitch = #off then if objectp(colorcrsr) then colorcrsr(mGetSetCursor, getProp(YugoCursors, thisCursor)) else castCursor(getProp(YugoCursors, thisCursor)) end if set gCursorSwitch to #on end if end on setCursorQuality recommendation global oPuppeteer set the cursorQuality of oPuppeteer to recommendation end on castCursor cursorID set myCursorOffset to 2500 if integerp(cursorID) then set whichCursor to cursorID - 6000 else put "castCursor(): wow, a cursor label: " put cursorID exit end if set cMask to myCursorOffset + (whichCursor * 2) cursor([cMask - 1, cMask]) end on killVideo global lastScoreSprite set vidSprite to 44 set the movieRate of sprite vidSprite to 0 set the locV of sprite vidSprite to -500 updateStage() set the castNum of sprite vidSprite to 7 puppetSprite(vidSprite, 0) end on pushVideo set vidSprite to 44 set the movieTime of sprite 44 to 0 updateStage() set the movieRate of sprite 44 to 1 repeat while the movieRate of sprite 44 <> 1 updateStage() end repeat end on setCurrentLocation suggestion return "Use the goTo() function instead.." end on goTo destination, transition global oPuppeteer, oStoryteller, builderWindow, gPreloading, gScanFinish, colorcrsr, YugoCursors, thisCursor, gCursorSwitch, gPeekAlertEnabled if objectp(colorcrsr) then colorcrsr(mGetSetCursor, getProp(YugoCursors, #noCursor)) else cursor(200) end if set gCursorSwitch to #off if (destination = #destination) or (transition = #transition) then exit end if setAt(getProp(the lsStateData of oStoryteller, #previousLocation), 1, getAt(getProp(the lsStateData of oStoryteller, #currentLocation), 1)) setAt(getProp(the lsStateData of oStoryteller, #currentLocation), 1, destination) if the castNum of sprite 44 <> 7 then killVideo() moveMovies(oPuppeteer) end if if transition <> 0 then setTransition(oPuppeteer, transition) end if moveToLocation(oPuppeteer) if getPos(the windowList, builderWindow) then tell builderWindow refreshCast() refreshHotspots() end tell end if if gPreloading = 1 then preloadLocations() else end if set lsMoveCounter to getProp(the lsStateData of oStoryteller, #moveCount) set oldCount to getAt(lsMoveCounter, 1) setAt(lsMoveCounter, 1, oldCount + 1) if (getState(oStoryteller, #playerHasPeekUnit) <> 0) and gPeekAlertEnabled then if (gScanFinish <> 0) and (the ticks > gScanFinish) then setState(oStoryteller, #PKscanStatus, #ReadyForPlayback) setState(oStoryteller, #PeekDisplay, #scanStatus) set gScanFinish to 0 end if if getState(oStoryteller, #BarOnline) and (getState(oStoryteller, #PeekDisplay) = #none) then set showTime to getState(oStoryteller, #hauntDelay) if (getAt(lsMoveCounter, 1) > showTime) and (destination <> #LivingRmBarCU2) then spawnGhostlyEvent() setProp(the lsStateData of oStoryteller, #hauntDelay, [max(0, showTime - 4)]) end if end if if getState(oStoryteller, #PeekDisplay) <> #none then peekAlert() setAt(lsMoveCounter, 1, 0) end if end if return #OK end on goBack global oStoryteller goTo(getState(oStoryteller, #previousLocation), #backOff) end on idle global lastCursor, thisCursor, cursorOffset, castCursorList, maxCursor, gClickLoc, oStoryteller, oPuppeteer, gCurrentHotspot, gItemInUse, domainIsReady, gPreloading, gStopTransitions, g16bit, gTransQuality, gFreezeInventory, gSoundPath, gOriginPoint, gMenuBottomY, gInventoryTopY, gGammaLevel, gDeferredTransit if gDeferredTransit = #none then if domainIsReady then cursorOn() if getState(oStoryteller, #itemInUse) = #none then set thisCursor to #pointer else set thisCursor to getState(oStoryteller, #itemInUse) end if set gCurrentHotspot to #none if the mouseV < gMenuBottomY then if the number of menus = 0 then installMenu(14) if gTransQuality = #none then set the checkMark of menuItem 1 of menu 3 to 1 end if if gTransQuality = #Better then set the checkMark of menuItem 2 of menu 3 to 1 end if if gTransQuality = #Best then set the checkMark of menuItem 3 of menu 3 to 1 end if set the checkMark of menuItem (8 - the soundLevel) of menu 2 to 1 if gGammaLevel <> "unknown" then set the checkMark of menuItem (8 - gGammaLevel) of menu 4 to 1 end if set thisCursor to #pointer end if else installMenu(0) end if if not gFreezeInventory then if the mouseV > gInventoryTopY then if the inventoryStatus of oPuppeteer = #cool then set the inventoryStatus of oPuppeteer to #hot updateInventory() updateStage() end if else if (the inventoryStatus of oPuppeteer = #hot) and (gClickLoc = #none) then set the inventoryStatus of oPuppeteer to #cool updateInventory() updateStage() end if end if end if if listp(gClickLoc) then set mouseLoc to gClickLoc - gOriginPoint else set mouseLoc to point(the mouseH, the mouseV) - gOriginPoint end if repeat with i in the lsLiveHotspots of oPuppeteer if inside(mouseLoc, getAt(i, 2)) then set myCursor to getAt(i, 1) if myCursor = #itemInUse then set thisCursor to getState(oStoryteller, #itemInUse) else set thisCursor to myCursor end if set gCurrentHotspot to i exit repeat end if end repeat if getState(oStoryteller, #itemInUse) = #none then if (the mouseCast = getProp(the lsForegroundData of oPuppeteer, #Headgear)) or (the mouseCast = getProp(the lsForegroundData of oPuppeteer, #HeadgearOff)) then set thisCursor to #pointer end if end if if (gCurrentHotspot = #none) and (the inventoryStatus of oPuppeteer = #hot) then set whichSlot to 1 repeat with i in [rect(77, 377, 144, 444), rect(147, 377, 214, 444), rect(217, 377, 284, 444), rect(287, 377, 354, 444), rect(357, 377, 424, 444), rect(427, 377, 494, 444), rect(497, 377, 564, 444)] if inside(mouseLoc, i) then set newItem to getAt(the lsInventory of oPuppeteer, whichSlot) if newItem <> #none then set gCurrentHotspot to [0, 0, ["useInventory(#" & newItem & ")"]] end if exit repeat next repeat end if set whichSlot to whichSlot + 1 end repeat end if if thisCursor <> lastCursor then if the movieRate of sprite 44 = 0 then cursorDance(value(lastCursor & "To" & thisCursor)) else cursorDance(0) end if set lastCursor to thisCursor end if if getState(oStoryteller, #BT_fragStatus) = #spinningNow then refreshAlignmentPuzzle() end if if getState(oStoryteller, #AMBERVISION) = #on then playDomainEntrySound() if (the lastEvent > (5 * 60)) and (the castNum of sprite 44 = 7) then ripple() end if end if end if if listp(gClickLoc) then set gClickLoc to #none end if else do(gDeferredTransit) if gDeferredTransit contains "waiting" then if domainIsReady = 1 then if getState(oStoryteller, #currentDomain) = the last word in gDeferredTransit then set gDeferredTransit to #none end if end if end if end if end on cursorDance cursorList global colorcrsr, thisCursor, YugoCursors, gCPU if gCPU <> #PC then if not objectp(colorcrsr) then cursor(-1) set colorcrsr to ColorCursor(mnew) end if end if if not listp(cursorList) then if objectp(colorcrsr) then colorcrsr(mGetSetCursor, getProp(YugoCursors, thisCursor)) else castCursor(getProp(YugoCursors, thisCursor)) end if exit end if set flipBook to cursorList if objectp(colorcrsr) then repeat with flipper = 1 to count(flipBook) startTimer() colorcrsr(mGetSetCursor, getAt(flipBook, flipper)) repeat while 2 > the timer nothing() end repeat end repeat else repeat with flipper = 1 to count(flipBook) startTimer() castCursor(getAt(flipBook, flipper)) repeat while 2 > the timer nothing() end repeat end repeat end if end on inState stateVar, whichItem global oStoryteller set statelist to getProp(the lsStateData of oStoryteller, stateVar) return getPos(statelist, whichItem) end on trimState stateVar, whichItem global oStoryteller set statelist to getProp(the lsStateData of oStoryteller, stateVar) set myPos to getPos(statelist, whichItem) if myPos then deleteAt(statelist, myPos) end if end on addState stateVar, whichItem global oStoryteller set statelist to getProp(the lsStateData of oStoryteller, stateVar) set myPos to getPos(statelist, whichItem) if not myPos then append(statelist, whichItem) end if end on patchPalette global oFixPal oFixPal(mPatchIt) end on forcePalette palName global oPuppeteer, gCurrentPalette puppetPalette(palName, 60) set gCurrentPalette to #changeMe patchPalette() end on loadMultiFrames whichOnes global oPuppeteer set theFrames to getaProp(the lsMultiFrames of oPuppeteer, whichOnes) if listp(theFrames) then repeat with i in theFrames preLoadCast(i) end repeat else alert("Hey! There's no such list in lsMultiframes!") end if end on purgeMultiframes whichOnes global oPuppeteer set theFrames to getaProp(the lsMultiFrames of oPuppeteer, whichOnes) if listp(theFrames) then repeat with i in theFrames unLoadCast(i) end repeat else alert("Hey! There's no such list in lsMultiframes!") end if end on gammaFade upOrDown, howFast global gCPU if gCPU = #PC then exit end if set speedCodes to [#glacial: "4", #slow: "18", #fast: "36", #instant: "100"] set mySpeed to getaProp(speedCodes, howFast) if voidp(mySpeed) then set mySpeed to getProp(speedCodes, #fast) end if if upOrDown = #down then MonitorFade("down", mySpeed) else updateStage() MonitorFade("up", mySpeed) end if end on fadeTest gammaFade(#down) wait(15) gammaFade(#up, #glacial) end on setColor howManybits set the colorDepth to howManybits if the colorDepth <> howManybits then if howManybits = 16 then set the colorDepth to 32 else put "Sorry, Director sez the colorDepth is " & the colorDepth & " bits.." end if else end if end on waitAsec startSwitch global gSecStart if voidp(gSecStart) then set gSecStart to #idle end if if startSwitch = #start then set gSecStart to the ticks return #starting else set currentTime to the ticks if currentTime > (gSecStart + 60) then return #finished set gSecStart to #idle else return #waiting end if end if end on putDownThePhone global oStoryteller, oPuppeteer if (getState(oStoryteller, #phoneButtonsPressed) > 0) and inState(#hauntsRemaining, #spookyOperator) then setProp(the lsStateData of oStoryteller, #phoneButtonsPressed, [7]) setState(oStoryteller, #ghostlyPhoneCall, #speaking) setProp(the lsStateData of oStoryteller, #phoneButtonsPressed, [0]) else setState(oStoryteller, #playerIsExaminingPhone, 0) setState(oStoryteller, #ghostlyPhoneCall, #done) setProp(the lsStateData of oStoryteller, #phoneButtonsPressed, [0]) setTransition(oPuppeteer, #fadeIn) end if updateDisplay(oPuppeteer) end on updateInventory global oPuppeteer, oStoryteller, gOriginPoint set foundationSprite to 3 set itemV to 410 set itemH to 110 set itemInHand to getState(oStoryteller, #itemInUse) set lsInventory to the lsInventory of oPuppeteer set lsInventoryData to the lsInventoryData of oPuppeteer if the inventoryStatus of oPuppeteer = #hot then repeat with i = 1 to 7 set itemName to getAt(lsInventory, i) set itemSprite to foundationSprite + i if (itemName = #none) or (itemName = itemInHand) then set the castNum of sprite itemSprite to 6 set the loc of sprite itemSprite to point(320, -360) + gOriginPoint else puppetSprite(itemSprite, 1) set the castNum of sprite itemSprite to getAt(getProp(lsInventoryData, itemName), 1) set the loc of sprite itemSprite to point(itemH, itemV) + gOriginPoint end if set itemH to itemH + 70 end repeat else repeat with i = 1 to 7 set itemName to getAt(lsInventory, i) set itemSprite to foundationSprite + i if (itemName = #none) or (itemName = itemInHand) then set the castNum of sprite itemSprite to 6 set the loc of sprite itemSprite to point(320, -360) + gOriginPoint else puppetSprite(itemSprite, 1) set the castNum of sprite itemSprite to getAt(getProp(lsInventoryData, itemName), 2) set the loc of sprite itemSprite to point(itemH, itemV) + gOriginPoint end if set itemH to itemH + 70 end repeat end if end on stashClick global gClickLoc set gClickLoc to point(the mouseH, the mouseV) end